package org.wiztools.te.plugin;

import org.wiztools.te.TEMod;
import org.wiztools.te.TEProcessAdapter;

import org.wiztools.te.plugin.helper.CommentHelper;

public class MarkupComment extends TEProcessAdapter{
	private TEMod tem;
	
	private static final String startChar = "<!--";
	private static final String endChar = "-->";
	private static final String quotedChar = "// Close_Comment_Replaced";
	
	public void setTEMod(TEMod tem){
		this.tem = tem;
	}
	
	public void action(){
		String str = tem.getSelectedText();
		if(str != null ){
			tem.replaceSelection(CommentHelper.multiLineComment(str, startChar, endChar, quotedChar));
		}
		else{
			tem.insert(CommentHelper.multiLineComment("", startChar, endChar, quotedChar));
		}
	}
}
